package com.example.stream.demostream.entity;

import com.zhe.web.valid.SaveGroup;
import com.zhe.web.valid.UpdateGroup;
import com.zhe.web.valid.annotations.ListValue;
import com.zhe.web.valid.annotations.PhoneNum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author zhonghuaen
 * @create 2021-09-10
 */
@Data
@ApiModel(value = "人类",description = "人类信息")
public class Person implements Serializable {

    @ApiModelProperty("id")
    private String id;

    @NotBlank(message = "手机号不能为空",groups = SaveGroup.class)
    @PhoneNum(groups = SaveGroup.class)
    @ApiModelProperty("手机号")
    private String phone;


    @NotBlank(message = "姓名不能为空",groups = UpdateGroup.class)
    @ApiModelProperty("姓名")
    private String name;

    @ListValue(value = {0,1},groups = SaveGroup.class)
    @ApiModelProperty("状态")
    private Integer status;
}
